package com.lagou.edu.service.impl;

import com.lagou.edu.dao.ResumeDao;
import com.lagou.edu.pojo.Resume;
import com.lagou.edu.service.ResumeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ResumeServiceImpl implements ResumeService {

    @Autowired
    private ResumeDao resumeDao;

    @Override
    public List<Resume> queryAll() throws Exception {
        return resumeDao.findAll();
    }

    @Override
    public Resume save(Resume resume) throws Exception {
        return resumeDao.save(resume);
    }

    @Override
    public void delete(Long id) throws Exception {
        resumeDao.deleteById(id);
    }

    @Override
    public void update(Resume resume) throws Exception {
        resumeDao.update(resume.getName(), resume.getAddress(), resume.getPhone(), resume.getId());

}

    @Override
    public Resume getResume(Long id) throws Exception {
        return resumeDao.getResume(id);
    }
}
